import Vue from 'vue'
import Router from 'vue-router'
import App1 from "./micro/app1/index.vue"
import App2 from "./micro/app2/index.vue"
Vue.use(Router)

const routes = [
  {
    path: '/',
    redirect: { name: 'home' },
    component: () => import(/* webpackChunkName: "main" */ './views/main/index.vue'),
    children: [
      {
        path: '/home',
        name: 'home',
        component: () => import(/* webpackChunkName: "home" */ './views/home/index.vue'),
      },
      {
        path: '/about',
        name: 'about',
        component: () => import(/* webpackChunkName: "about" */ './views/about/index.vue'),
      },

    ]
  },
  // 子应用路由容器
  {
    path: "/app1",
    name: "app1",
    component: App1,
  },
  {
    path: "/app2",
    name: "app2",
    component: App2,
  },
]

const router = new Router({
  mode: 'history',
  routes: routes,
})

export default router
